﻿// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import 'babel-polyfill'
import ddelement from 'ddelement'
import infiniteScroll from 'vue-infinite-scroll'

// import 'normalize.css/normalize.css'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// 引入store
import store from './store'
import { formmatDate } from '@/utils/index.js'

// 引入自己的ul，li 组件
import MyUL from './components/Common/ul'
import MyLi from './components/Common/li'

// 主题样式
// import '@/assets/theme/index.css'
import DatePicker from '@/components/datePickerRang/index.js'
import export2Report from '@/components/exportExcel/index.js'
import reportSelectWay from '@/components/reportSelectWay/index.js'
// 全局css样式
import '@/assets/style/index.scss'
// 自己生成的字体图片
import '@/assets/fonts/saasIcon/iconStyle.css'

// 国际化
import i18n from './lang'

// 接口数据模拟
import './mock'
import './utils/app'
// 全局注册
Vue.prototype.formmatDate = formmatDate
// 定义全局变量
Vue.component(MyUL.name, MyUL)
Vue.component(MyLi.name, MyLi)
// 全局消息分发器
window.eventEmitter = new Vue()

// 使用Element UI
Vue.use(Element, {
    i18n: (key, value) => i18n.t(key, value)
})

Vue.use(ddelement)

ddelement.DdLog.initIndexDB('reportDB', 'reportTable')

Vue.config.productionTip = false
Vue.use(infiniteScroll)
Vue.use(DatePicker)
Vue.use(export2Report)
Vue.use(reportSelectWay)
/* eslint-disable no-new */
new Vue({
    el: '#app',
    i18n,
    router,
    store, // 使用store
    components: { App },
    template: '<App/>'
})
